Incorrect forwarding with common root at the same level#346
Incorrect forwarding with common root at the same level#3460-gravity wants to merge 3 commits intoSaturnFramework:mainfrom
Conversation
|
In my opinion all formatted paths should come before normal ones, which means: |
|
I believe there are cases where a concrete path would be desired to have precedence. Hypothetical Example:
One might want the featured products to go to a special page formatted for display, whereas the application might also support user-generated tags for products, which could show on a default display. While this could also be done within the handler logic itself (which I think would be better in most cases), there may be other complicating logic which determines the route to be the cleanest spot to separate the branches at. Just thinking out loud here, but how would that be doable with this new routing? |
|
It works just fine, unless I missed some cases. let apiRouter = router { let appRouter = router { let app = run app` I could not come up with an example in which request may fail. |
|
No you're right that looks to be the correct behavior. |
I did not get this @0-gravity. Why you make this proposition? It appears that you want to make generic paths to be evaluated before specific paths. I don't think this is a good idea. |
Incorrect forwarding with common root at the same level
for example next routing will fail
router { forward $"/roots" (text "roots") forwardf "/roots/%O" (sprintf "roots/%O" >> text) }